﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using TradeDataAPI.Core.Quartz;

namespace TradeDataAPI.Core.Filters
{
    public interface IApiTaskFilter : IFilterMetadata
    {
        AuthorizationFilterContext OnAuthorization(AuthorizationFilterContext context);
    }
    public class ApiTaskAttribute : Attribute, IApiTaskFilter, IAllowAnonymous
    {
        public AuthorizationFilterContext OnAuthorization(AuthorizationFilterContext context)
        {
            return QuartzAuthorization.Validation(context);
        }
    }

}
